<#-- 创建快照商品基本信息标签 -->
<#assign goodsSnapshotBaseDataTag= newTag("goodsSnapshotBaseDataTag") >
<#-- 调用标签获取商品基本信息 -->
<#assign goods= goodsSnapshotBaseDataTag("'snapshot_id':${snapshot_id!0}")>
<#if  goods.page_title?? && goods.page_title!="" >
	<#assign  title="${goods.page_title}" />
<#else>
	<#assign  title="${goods.name}" />
</#if>

<#if goods.meta_keywords?? &&  goods.meta_keywords!="">
	<#assign  keywords="${goods.meta_keywords}" />
</#if>

<#if goods.meta_description?? &&  goods.meta_description!="">
	<#assign  description="${goods.meta_description}" />
</#if>
<#include 'common/header.html' />
<#include 'common/reception_header.html'/>
<script>
	var ctx="${ctx}";
</script>
<link rel="stylesheet" href="${ctx}${themes_path}/css/goods.css" type="text/css" />

<script src="${ctx}${themes_path}/js/magiczoom.js" type="text/javascript"></script>
<script src="${ctx}${themes_path}/js/jcarousellite_1.0.1.min.js" type="text/javascript"></script>
<script src="${ctx}${themes_path}/js/favorite.js" type="text/javascript"></script>
<script src="${ctx}${themes_path}/js/jquery.numinput.js" type="text/javascript"></script>
<script src="${ctx}${themes_path}/js/Goods.js" type="text/javascript"></script>
<script src="${ctx}${themes_path}/js/spec.js" type="text/javascript"></script>
<script src="${ctx}${themes_path}/js/Comment.js" type="text/javascript"></script>
<script  src="${ctx}${themes_path}/js/airlines.js"  ></script>
<!-- 引用图片点击放大js插件css文件-->
<link rel="stylesheet" type="text/css" href="${ctx}${themes_path}/css/lightbox.css" />
<!-- 引用图片点击放大js插件-->
<script src="${ctx}${themes_path}/js/lightbox.js"></script>
<link rel="stylesheet" href="${ctx}${themes_path}/css/reveal.css" type="text/css" />
<script src="${ctx}${themes_path}/js/jquery.reveal.js" type="text/javascript"></script>
<#-- 创建快照商品相册标签 -->
<#assign goodsSnapshotGalleryTag= newTag("goodsSnapshotGalleryTag")>
<#-- 调用标签获取商品相册信息 -->
<#assign galleryList= goodsSnapshotGalleryTag()!'' >

<#-- 创建快照商品属性标签 -->
<#assign goodsSnapshotAttributeListTag= newTag("goodsSnapshotAttributeListTag")>
<#-- 调用标签获取商品属性信息 -->
<#assign attrList= goodsSnapshotAttributeListTag("'snapshot_id':${goods.snapshot_id!''}")!'' >

<#-- 创建快照商品参数标签 -->
<#assign goodsSnapshotParametersTag= newTag("goodsSnapshotParametersTag")>
<#-- 调用标签获取快照商品参数信息 -->
<#assign goodsPara= goodsSnapshotParametersTag("'snapshot_id':${goods.snapshot_id!''}")!'' >

<#-- 获得商品参数的参数组 -->
<#if goodsPara.hasParam==true>
	<#assign para = goodsPara.paramList>
</#if>

<!-- 创建当前位置标签 -->
<#assign goodsNav= newTag("goodsNavTag")>
<!-- 获取当前位置结果 -->
<#assign goodscat = goodsNav()!'' >
<#-- 创建商品评论数量标签 -->
<#assign commontGradenNumTag= newTag("commontGradenNumTag")>
<#assign gradenNum= commontGradenNumTag("'goods_id':${goods.goods_id!''}")!'' >

<!--Main开始-->
<div class="goods-main">
	<div class="goods-navigation">
		<span class="float b">您的当前位置：</span><span class="nav-title">${goodscat.navHtml}</span>
	</div>
	<!-- 商品详细 -->
	<#include 'detail/goods_snapshot_detail.html' />
	<div class="main-details">
		<div class="main-details-left">
			<div class="details-left-same">
				<h1>推荐商品</h1>
				<#assign goodsListTag = newTag("goodsListTag")>
				<#assign goodsList=goodsListTag("'tagid':'1','goodsnum':'6'")>
				<div class="hot-titArea-cont-list">
					<#list goodsList as goods>
					<dl>
						<dt>
							<a target="_blank" href="${ctx}/goods-${goods.goods_id}.html" >
								<@image class="scrollLoading" src="${goods.thumbnail!''}" alt="${goods.name}" />
							</a>
						</dt>
						<dd>
							<a target="_blank" href="${ctx}/goods-${goods.goods_id}.html"><@substring	title="${goods.name!''}" length="22" dot="..." /></a>
						</dd>
						<dd>
							<span class="price">${goods.price?string.currency}</span>
							<span class="discount f12">${goods.mktprice?string.currency}</span>
						</dd>
					</dl>
					</#list>
				</div>
			</div>
		</div>
		<div class="rer-detail float-nav">
			<div class="nav content-main-tit" id="comment-tab">
				<span class="selected goods_d" rel="1">商品详情</span>
				<span class="goods_common" rel="2">商品评论</span>
				<span class="goods_sell" rel="4">销售记录</span>
			</div>
			<script type="text/javascript">
				$(function(){
					$('#comment-tab').waypoint(function(event, direction) {
				        $(this).parent().parent().parent().toggleClass('sticky', direction === "down");
				        $(".float-go-cart").toggle(100);
				        event.stopPropagation();
				    });
				});	
			</script>
	
			<!-- 详细及其他内容 -->
			<div class="tab_main">
				<div class="proDcon goods_tab_intro1" >
					<#include 'detail/goods_props.html' />
					${goods.intro!''}
				</div>
				<div class="proDcon goods_tab_intro2" style="display:none">
					<div class="grade_tab">
						<ul>
							<li class="height_grade selected" rel="4">全部(${gradenNum.allCommentNum!0})</li>
							<li class="height_grade" rel="3">好评(${gradenNum.gradeHigh!0})</li>
							<li class="middel_grade" rel="2">中评(${gradenNum.gradeTwo!0})</li>
							<li class="low_geade" rel="1">差评(${gradenNum.gradeLow!0})</li>
						</ul>
					</div>
					<div id="discuss_wrapper_list" >
						<!-- 评论列表 -->
					</div>
				</div>
				<!-- 成交记录 -->
				<div id="record_wrapper" class="proDcon goods_tab_intro4" style="display:none">

				</div>
			</div>
		</div>
	</div>
</div>

<script>
	$(function(){
		loadRecord_wrapper(1);
		loadDiscuss_wrapper_list(1);
		loadAsk_wrapper_list(1);
		
		//标签切换
		$(".content-main-tit span").click(function(){
			var sote = $(this).attr("rel");
			$(".content-main-tit span").removeClass("selected");
			$(this).addClass("selected");
			$(".tab_main .proDcon").hide();
			$(".goods_tab_intro"+sote).show();
			//  添加切换同时滚动到该高度效果  _by: Andste 2016-9-28 12:50:50
			$('body,html').animate({ scrollTop: 805 }, 300);
		})
		
		//评论切换
		$(".grade_tab ul li").click(function(){
			var gradeNum = $(this).attr("rel");
			if(gradeNum == 4){
				loadDiscuss_wrapper_list(1);
			}else{
				loadDiscuss_grade_list(1,gradeNum);
			}
			
			$(".grade_tab ul li").removeClass("selected");
			$(this).addClass("selected");
		})
		
		//成交记录
		function loadRecord_wrapper(page){
			$("#record_wrapper").load("detail/record_list.html?goods_id="+${goods.goods_id}+"&page="+page,function(){
				$("#record_wrapper .page li a").click(function(){
					var pageno= $(this).attr("page");
					loadRecord_wrapper(pageno);
				});
			});	
		}
		
		//商品评论
		function loadDiscuss_wrapper_list(page){
			$("#discuss_wrapper_list").load("detail/discuss_list.html?goods_id="+${goods.goods_id}+"&page="+page,function(){
				$("#discuss_wrapper_list .page li a").click(function(){
					var pageno= $(this).attr("page");
					loadDiscuss_wrapper_list(pageno);
				});
			});	
		}
		
		//商品评论分级
		function loadDiscuss_grade_list(page,grade){
			$("#discuss_wrapper_list").load("detail/grade_list.html?goods_id="+${goods.goods_id}+"&page="+page+"&grade="+grade,function(){
				$("#discuss_wrapper_list .page li a").click(function(){
					var pageno= $(this).attr("page");
					loadDiscuss_wrapper_list(pageno);
				});
			});	
		}

		
		function loadAsk_wrapper_list(page){
			$("#ask_wrapper_list").load("detail/ask_list.html?goods_id="+${goods.goods_id}+"&page="+page,function(){
				$("#ask_wrapper_list .page li a").click(function(){
					var pageno= $(this).attr("page");
					loadAsk_wrapper_list(pageno);
				});
			});	
		}
		
 		/* $(".content-main-tit .goods_d").click(function(){
			$(".goods_sell").hide();
			$(".proDcon").show();
			$(".content-main-tit span").removeClass("selected");
			$(this).addClass("selected");
		})  */
	})
	
	//设置图片缩放的属性	add by DMRain 2016-5-11
	lightbox.option({
		'albumLabel': '第%1张   共%2张',	//设置显示的文字
	    'maxWidth': 500,			//设置显示图片弹出框的宽度
	    'maxHeight': 500,			//设置显示图片弹出框的高度
	    'resizeDuration': 300,		//设置图片显示的加载时间(毫秒)
	    'positionFromTop': 100,		//设置弹出框到屏幕顶部的距离
	    'wrapAround': true			//设置可以循环查看图片
	})
</script>


<script type="text/javascript">
var jiathis_config = {data_track_clickback:'true'};
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=1988640" charset="utf-8"></script>
<!-- JiaThis Button END -->
<!--Main end-->
<#include 'common/footer.html'/>
